@extends('public.main')
@section('title', '趣图列表|❤大千世界，我们并不是缺少一个说话的朋友，而是渴望一个理解自己读懂自己的伙伴。')

@section('css')
    <meta name="keywords" content="❤大千世界，我们并不是缺少一个说话的朋友，而是渴望一个理解自己读懂自己的伙伴。"/>
    <link rel="stylesheet" type="text/css" href="{{ asset('/static/css/index.css') }}">
@endsection

@section('content')
    <div class="container">
    <div class="col-lg-12 col-md-12 col-xs-12">
        <div class="col-lg-8 col-md-8 col-xs-8">
            <div class="col-lg-12 col-md-12 col-xs-12 content_left">
                @include('public.content', ['datas' => $pictures, 'printType' => 2])
            </div>

            <div class="col-lg-12 col-md-12 col-xs-12" style="text-align: center">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        @if( $currentPage==1 )
                            <li class="disabled">
                                <a aria-label="Previous">
                                    <span aria-hidden="true">上一页</span>
                                </a>
                            </li>
                        @else
                            <li>
                                <a href="/picture?page={{ $currentPage-1 }}" aria-label="Previous">
                                    <span aria-hidden="true">上一页</span>
                                </a>
                            </li>
                        @endif


                        <!-- 判断分页数是否到达5 -->
                            @if( $page_num <= 5 )
                                @for($i=1;$i<=$page_num;$i++)
                                    @if( $currentPage==$i )
                                        <li class="active"><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                    @else
                                        <li><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                    @endif
                                @endfor
                            @else
                                @if( $currentPage <= 2 )
                                    @for($i=1;$i<=5;$i++)
                                        @if( $currentPage==$i )
                                            <li class="active"><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                        @else
                                            <li><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                        @endif
                                    @endfor
                                @else

                                    @for($i = $currentPage-2;$i <= (($page_num>$currentPage+2)?($currentPage+2):$page_num);$i++)
                                        @if( $currentPage==$i )
                                            <li class="active"><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                        @else
                                            <li><a href="/picture?page={{ $i }}">{{ $i }}</a></li>
                                        @endif
                                    @endfor
                                @endif
                            @endif

                        @if( $currentPage==$page_num )
                            <li class="disabled">
                                <a aria-label="Next">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                        @else
                            <li>
                                <a href="/picture?page={{ $currentPage+1 }}" aria-label="Next">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                        @endif
                    </ul>
                </nav>
            </div>
        </div>
        <div class="col-lg-4 col-md-4 col-xs-4" style="text-align: center">
            <div class="col-lg-12 col-md-12 col-xs-12 content_right">
                <div class="col-lg-12 col-md-12 col-xs-12">
                    <h4>快来扫一扫微信二维码，更多精彩内容等你来发现。</h4>
                    <img src="{{ asset('/static/img/erweima.jpg') }}" style="max-width: 100%">
                </div>
                <div class="col-lg-12 col-md-12 col-xs-12">
                    <iframe width="100%" height="400" class="share_self" frameborder="0" scrolling="no"
                            src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=400&fansRow=1&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=5605043482&verifier=f260c920&dpc=1"></iframe>
                </div>
                <script type="text/javascript">
                    document.write('<a style="display:none!important" id="tanx-a-mm_56967596_36728993_134034968"></a>');
                    tanx_s = document.createElement("script");
                    tanx_s.type = "text/javascript";
                    tanx_s.charset = "gbk";
                    tanx_s.id = "tanx-s-mm_56967596_36728993_134034968";
                    tanx_s.async = true;
                    tanx_s.src = "http://p.tanx.com/ex?i=mm_56967596_36728993_134034968";
                    tanx_h = document.getElementsByTagName("head")[0];
                    if(tanx_h)tanx_h.insertBefore(tanx_s,tanx_h.firstChild);
                </script>
                <script type="text/javascript">
                    document.write('<a style="display:none!important" id="tanx-a-mm_56967596_36728993_134034968"></a>');
                    tanx_s = document.createElement("script");
                    tanx_s.type = "text/javascript";
                    tanx_s.charset = "gbk";
                    tanx_s.id = "tanx-s-mm_56967596_36728993_134034968";
                    tanx_s.async = true;
                    tanx_s.src = "http://p.tanx.com/ex?i=mm_56967596_36728993_134034968";
                    tanx_h = document.getElementsByTagName("head")[0];
                    if(tanx_h)tanx_h.insertBefore(tanx_s,tanx_h.firstChild);
                </script>
            </div>
        </div>
    </div>
    </div>
@endsection

@section('script')
    <script>

    </script>
@endsection